use serde::{Deserialize, Serialize};
use validator::Validate;
use wanmesh_common::validator::validate_string_is_not_empty;

#[derive(Serialize, Deserialize, Validate, Debug, Clone)]
pub struct AddParams {
    #[validate(custom(function = "validate_string_is_not_empty"))]
    pub name: String,
    #[serde(default)]
    pub description: String,
    #[validate(custom(function = "validate_string_is_not_empty"))]
    pub headend: String,
    #[validate(custom(function = "validate_string_is_not_empty"))]
    pub endpoint: String,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct AddResponseData {
    pub te_policy_group_id: String,
}

#[derive(Serialize, Deserialize, Validate, Debug, Clone, Default, Eq, PartialEq)]
pub struct UpdateParams {
    pub name: Option<String>,
    pub description: Option<String>,
}

#[derive(Serialize, Deserialize, Validate, Debug, Clone, Default, Eq, PartialEq)]
pub struct Filter {
    pub name: Option<String>,
    pub headend: Option<String>,
    pub endpoint: Option<String>,
}
